home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Linux Cubed Series 7: Sunsite
/
Linux Cubed Series 7 - Sunsite Vol 1.iso
/
system
/
backup
/
kbackup-.000
/
KBackup-1.2.7.tar
/
KBackup
/
src
/
checkprogs
< prev
next >
Wrap
Text File
|
1996-02-13
|
3KB
|
125 lines
# /home/kbackup/.CVSROOT/KBackup/src/checkprogs,v 1.6 1996/02/13 20:49:59 kbackup Exp
#
# This file is Copyright (C) 1995 by Karsten Ballⁿder
# Karsten.Ballueder@stud.uni-karlsruhe.de
#
# It is part of the KBackup package, see the file COPYING for details.
#
#
HasSED=NO
HasDIALOG=NO
HasTAR=NO
HasAFIO=NO
HasAFIO242=NO
HasFGREP=NO
HasGREP=NO
HasDD=NO
HasNot=
MYDIALOGTITLE="KBackup"
export HasSED HasDIALOG HasTAR HasAFIO HasDD HasNot
mydialog()
{
dialog --backtitle "$MYDIALOGTITLE" "$@"
}
check_progs()
{
clear
echo -n "Checking for required programs: "
if [ "$TTYMODE" != YES ]
then
echo -n "$DIALOG "
$DIALOG 2>/dev/null
if [ $? != 127 ] ;then HasDIALOG=YES ; else HasNot="$HasNot $DIALOG";fi
if [ $HasDIALOG = YES ]
then
$DIALOG --backtitle "test" --infobox "test" 5 20 2>/dev/null && clear
if [ $? = 0 ]
then
DIALOG=mydialog
fi
fi
clear
echo -n "Checking for required programs: "
echo -n "$DIALOG "
else
DIALOG=mydialog
fi
echo -n "$SED "
$SED 2>/dev/null
if [ $? != 127 ] ;then HasSED=YES ; else HasNot="$HasNot $SED";fi
echo -n "$FGREP "
$FGREP 2>/dev/null
if [ $? != 127 ] ;then HasFGREP=YES ; else HasNot="$HasNot $FGREP";fi
echo -n "$GREP "
$GREP 2>/dev/null
if [ $? != 127 ] ;then HasGREP=YES ; else HasNot="$HasNot
$GREP";fi
echo -n "$TAR "
$TAR 2>/dev/null
if [ $? != 127 ] ;then HasTAR=YES ; else HasNot="$HasNot $TAR";fi
echo -n "$AFIO "
$AFIO 2>/dev/null
if [ $? != 127 ]
then
HasAFIO=YES
$AFIO -V | $SED '1,$ s/^.*Version \([0-9][0-9]*\)\.\([0-9][0-9]*\)\.\([0-9][0-9]*\) .*$/a=\1;b=\2;c=\3/g' >/tmp/.tmp$$
. /tmp/.tmp$$
rm -f /tmp/.tmp$$
ver=`expr \( \( $a \* 100 \) + $b \) \* 100 + $c `
if [ $ver -gt 20401 ]
then
HasAFIO242=YES
echo -n "(2.4.2 or newer) "
fi
else
HasNot="$HasNot $AFIO"
fi
echo "$DD "
$DD 2>/dev/null </dev/null
if [ $? != 127 ] ;then HasDD=YES ; else HasNot="$HasNot $DD";fi
if [ $HasDIALOG != YES -a "$TTYMODE" != YES ]
then
echo -e "\n\aCannot find dialog program!
Running in simple shell mode instead.
Press Enter to continue..."
read
fi
if [ $HasDIALOG = NO -o "$TTYMODE" = YES ] && [ "$DIALOG_SRC_FILE" != "" ]
then
echo -e "\tLoading dialog-emulation script..."
. "$DIALOG_SRC_FILE"
DIALOG=mydialog
fi
}
report_missing()
{
if [ "$HasNot" != "" ]
then
echo -e "
\aThe following programs are not installed or their paths are not set
properly. For full functionality of KBackup you should install them.
missing: $HasNot
Press RETURN key to continue anyway...
"
read
fi
}